<template>
  <div>
    <!-- 无传参,事件处理函数的第一个形参就是事件对象s -->
    <a @click="goToBaidu" href="">阻止去百度</a>
    <hr />
    <a @click="goToBaiduArg(10,$event)" href="https://www.baidu.com">阻止去百度</a>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    goToBaidu(e) {
      e.preventDefault()
    },
    goToBaiduArg(num,e) {
      e.preventDefault()
    },
  },
};
</script>

<style lang="scss" scoped>
</style>